package Fp

//
//import (
//	"fmt"
//	"db2s/global"
//	"reflect"
//	"strings"
//	"sync/atomic"
//)
//
///*
//NullObject 判断是否需要发送null值
//*/
//func (sp TaskDistribution) NullObject(cn []string, logSeq int64) bool {
//	//var (
//	//	s     bool
//	//	event = "[NullObject]"
//	//)
//	//if WLog != nil {
//	//	WLog.Debug(fmt.Sprintf("(%v) %v Start analyzing whether the index column data type of table %v.%v is null. index column is {%v} table meta is {%v}", logSeq, event, sp.TableObject.Schema, sp.TableObject.Table, cn, sp.TableInfo.TableColumn))
//	//}
//	//for _, v1 := range cn {
//	//	for _, v := range sp.TableInfo.TableColumn {
//	//		if strings.EqualFold(v.ColumnName, v1) && strings.EqualFold(v.IsNull, "Y") {
//	//			s = true
//	//			if WLog != nil {
//	//				WLog.Info(fmt.Sprintf("(%v) %v Null values are allowed in index column %v of table %v.%v. null column name is %v", logSeq, event, cn, sp.TableObject.Schema, sp.TableObject.Table, v.ColumnName))
//	//			}
//	//			return s
//	//		}
//	//	}
//	//}
//	//return s
//	return false
//}
//
//func (sp TaskDistribution) fistRows(ws, wc []string, firstLineMap map[string]int) bool {
//	kk := fmt.Sprintf("%v,%v", strings.Join(ws, global.SchemaTableSplit), strings.Join(wc, global.SchemaTableSplit))
//	if _, okk := firstLineMap[kk]; !okk && len(firstLineMap) > 0 {
//		return false
//	} else {
//		return true
//	}
//}
//
///*
//判断每个分段的起始值和末尾值，第一个值是否大于第二个值
//*/
//func (sp TaskDistribution) segmentation(cds, ws, wc []string) bool {
//	var (
//		swsPoint int
//	)
//	res, _ := sp.columnValue(cds, ws, wc)
//	for k, v := range res { //比对分段当前值和结尾值，出现当前值>结尾值，则减半
//		if k >= swsPoint {
//			continue
//		}
//		if v == -1 {
//			return false
//		}
//		if v == 1 {
//			return true
//		}
//	}
//	return false
//}
//
//// leadingColumn 前导列值比较处理
//func (sp TaskDistribution) leadingValue(vl valueLocationInput) (whereLeft, []whereRight) {
//	var (
//		whereRightGather              []whereRight
//		swsLeftGather, swsRightGather []map[string]string
//		//pLeftGather, pRightGather  []map[string]string
//	)
//	//for k1, v1 := range vl.wc {
//	//	oldValue, newValue := nullValue(vl.ws[k1]), nullValue(v1)
//	//	var querySymbolLeft string
//	//	if int64(k1) == vl.k {
//	//		querySymbolLeft = ">"
//	//		pLeftGather = append(pLeftGather, map[string]string{"columnName": sp.TableInfo.IndexColumn[k1], "columnDataLeft": oldValue, "querySymbolLeft": querySymbolLeft})
//	//		pRightGather = append(pRightGather, map[string]string{"columnName": sp.TableInfo.IndexColumn[k1], "columnDataRight": newValue, "querySymbolRight": "<="})
//	//		swsLeftGather = append(swsLeftGather, map[string]string{"columnName": sp.TableInfo.IndexColumn[vl.k], "columnDataLeft": vl.wc[vl.k], "querySymbolLeft": ">"})
//	//		whereRightGather = append(whereRightGather, whereRight{
//	//			pLeft:      pLeftGather,
//	//			pRight:     pRightGather,
//	//			compareSeq: vl.k,
//	//			Segment:    vl.Segment,
//	//		})
//	//	}
//	//}
//	return whereLeft{swsLeft: swsLeftGather, swsRight: swsRightGather}, whereRightGather
//}
//
//// 联合索引中间值出现差异
//func (sp TaskDistribution) middleValue(vl valueLocationInput) (whereLeft, []whereRight) {
//	var (
//		whereRightGather                                         []whereRight
//		pLeftGather, pRightGather, swsLeftGather, swsRightGather []map[string]string
//	)
//	for k1, v1 := range vl.wc {
//		oldValue, newValue := nullValue(vl.ws[k1]), nullValue(v1)
//		if int64(k1) < vl.k {
//			//leftSymbol, rightSymbol := eqSymbol("left", oldValue, true), eqSymbol("right", newValue, true)
//			//swsLeftGather = append(swsLeftGather, map[string]string{"columnName": sp.TableInfo.IndexColumn[k1], "columnDataLeft": oldValue, "querySymbolLeft": leftSymbol})
//			//swsRightGather = append(swsRightGather, map[string]string{"columnName": sp.TableInfo.IndexColumn[k1], "columnDataRight": newValue, "querySymbolRight": rightSymbol})
//			//pLeftGather = append(pLeftGather, map[string]string{"columnName": sp.TableInfo.IndexColumn[k1], "columnDataLeft": oldValue, "querySymbolLeft": leftSymbol})
//			//pRightGather = append(pRightGather, map[string]string{"columnName": sp.TableInfo.IndexColumn[k1], "columnDataRight": newValue, "querySymbolRight": rightSymbol})
//		} else if int64(k1) == vl.k {
//			var querySymbolLeft string
//			var nullBool *int32
//			querySymbolLeft = ">"
//			for k := range vl.nullMark {
//				if vl.k < int64(k) {
//					//nullBool = true
//					atomic.SwapInt32(nullBool, 1)
//					break
//				}
//			}
//			//swsLeftGather = append(swsLeftGather, map[string]string{"columnName": sp.TableInfo.IndexColumn[k1], "columnDataLeft": newValue, "querySymbolLeft": ">"})
//			if strings.EqualFold(querySymbolLeft, ">=") && (oldValue == "NULL" && newValue == "NULL") { //null 值合并
//				//pLeftGather = append(pLeftGather, map[string]string{"columnName": sp.TableInfo.IndexColumn[k1], "columnDataLeft": oldValue, "querySymbolLeft": "="})
//				//pRightGather = append(pRightGather, map[string]string{"columnName": sp.TableInfo.IndexColumn[k1], "columnDataRight": newValue, "querySymbolRight": "="})
//				whereRightGather = append(whereRightGather, whereRight{
//					pLeft:      pLeftGather,
//					pRight:     pRightGather,
//					compareSeq: vl.k,
//					Segment:    vl.Segment,
//					NullBool:   nullBool,
//				})
//				continue
//			}
//			switch querySymbolLeft {
//			case ">": //非首行，且出现了中间值大于情况，需要拆分成两个sql
//				//if int64(k1) >= vl.LastModifyPoint { //判断离散度值是否一直处于中间某一个列，不用进行拆分
//				//	pLeftGather = append(pLeftGather, map[string]string{"columnName": sp.TableInfo.IndexColumn[k1], "columnDataLeft": oldValue, "querySymbolLeft": querySymbolLeft})
//				//	pRightGather = append(pRightGather, map[string]string{"columnName": sp.TableInfo.IndexColumn[k1], "columnDataRight": newValue, "querySymbolRight": "<="})
//				//	whereRightGather = append(whereRightGather, whereRight{
//				//		pLeft:      pLeftGather,
//				//		pRight:     pRightGather,
//				//		compareSeq: vl.k,
//				//		Segment:    vl.Segment,
//				//		NullBool:   nullBool,
//				//	})
//				//	continue
//				//}
//				for _, j := range []string{"min", "max"} {
//					newLeftGather := sliceAnyCopy(pLeftGather).([]map[string]string)
//					newRightGather := sliceAnyCopy(pRightGather).([]map[string]string)
//					switch j {
//					case "min":
//						//newLeftGather = append(newLeftGather, map[string]string{"columnName": sp.TableInfo.IndexColumn[k1], "columnDataLeft": oldValue, "querySymbolLeft": ">="}, map[string]string{"columnName": sp.TableInfo.IndexColumn[k1+1], "columnDataLeft": vl.ws[k1+1], "querySymbolLeft": querySymbolLeft})
//						//newRightGather = append(newRightGather, map[string]string{"columnName": sp.TableInfo.IndexColumn[k1], "columnDataRight": oldValue, "querySymbolRight": "<="})
//						whereRightGather = append(whereRightGather, whereRight{
//							pLeft:      newLeftGather,
//							pRight:     newRightGather,
//							compareSeq: vl.k,
//							Segment:    vl.Segment,
//							NullBool:   nullBool,
//						})
//					case "max":
//						//newLeftGather = append(newLeftGather, map[string]string{"columnName": sp.TableInfo.IndexColumn[k1], "columnDataLeft": oldValue, "querySymbolLeft": querySymbolLeft})
//						//newRightGather = append(newRightGather, map[string]string{"columnName": sp.TableInfo.IndexColumn[k1], "columnDataRight": newValue, "querySymbolRight": "<="})
//						whereRightGather = append(whereRightGather, whereRight{
//							pLeft:      newLeftGather,
//							pRight:     newRightGather,
//							compareSeq: vl.k,
//							Segment:    vl.Segment,
//							NullBool:   nullBool,
//						})
//					}
//				}
//			case ">=":
//				switch {
//				case oldValue == "NULL": //首行，包含null值，且是>= null and <= not null
//					for _, j := range []string{"min", "max"} {
//						newLeftGather := sliceAnyCopy(pLeftGather).([]map[string]string)
//						newRightGather := sliceAnyCopy(pRightGather).([]map[string]string)
//						switch j {
//						case "min":
//							newLeftGather = append(newLeftGather, map[string]string{"columnName": sp.TableInfo.IndexColumn[k1], "columnDataLeft": oldValue, "querySymbolLeft": "="})
//							whereRightGather = append(whereRightGather, whereRight{
//								pLeft:      newLeftGather,
//								pRight:     newRightGather,
//								compareSeq: vl.k,
//								Segment:    vl.Segment,
//								NullBool:   nullBool,
//							})
//						case "max":
//							newLeftGather = append(newLeftGather, map[string]string{"columnName": sp.TableInfo.IndexColumn[k1], "columnDataLeft": oldValue, "querySymbolLeft": ">"})
//							newRightGather = append(newRightGather, map[string]string{"columnName": sp.TableInfo.IndexColumn[k1], "columnDataRight": newValue, "querySymbolRight": "<="})
//							whereRightGather = append(whereRightGather, whereRight{
//								pLeft:      newLeftGather,
//								pRight:     newRightGather,
//								compareSeq: vl.k,
//								Segment:    vl.Segment,
//								NullBool:   nullBool,
//							})
//						}
//					}
//				case newValue == "NULL":
//				default: //没有上述情况
//					pLeftGather = append(pLeftGather, map[string]string{"columnName": sp.TableInfo.IndexColumn[k1], "columnDataLeft": oldValue, "querySymbolLeft": querySymbolLeft})
//					pRightGather = append(pRightGather, map[string]string{"columnName": sp.TableInfo.IndexColumn[k1], "columnDataRight": newValue, "querySymbolRight": "<="})
//					whereRightGather = append(whereRightGather, whereRight{
//						pLeft:      pLeftGather,
//						pRight:     pRightGather,
//						compareSeq: vl.k,
//						Segment:    vl.Segment,
//						NullBool:   nullBool,
//					})
//				}
//			}
//		}
//	}
//	return whereLeft{swsLeft: swsLeftGather, swsRight: swsRightGather}, whereRightGather
//}
//func (sp TaskDistribution) lastValueGreaterThan(vl valueLocationInput) (whereLeft, []whereRight) {
//	var (
//		whereRightGather                                         []whereRight
//		pLeftGather, pRightGather, swsLeftGather, swsRightGather []map[string]string
//	)
//	for k1, v1 := range vl.wc {
//		oldValue, newValue := nullValue(vl.ws[k1]), nullValue(v1)
//		if int64(k1) < vl.k {
//			leftSymbol, rightSymbol := eqSymbol("left", oldValue, true), eqSymbol("right", newValue, true)
//			swsLeftGather = append(swsLeftGather, map[string]string{"columnName": sp.TableInfo.IndexColumn[k1], "columnDataLeft": oldValue, "querySymbolLeft": leftSymbol})
//			swsRightGather = append(swsRightGather, map[string]string{"columnName": sp.TableInfo.IndexColumn[k1], "columnDataRight": newValue, "querySymbolRight": rightSymbol})
//			pLeftGather = append(pLeftGather, map[string]string{"columnName": sp.TableInfo.IndexColumn[k1], "columnDataLeft": oldValue, "querySymbolLeft": leftSymbol})
//			pRightGather = append(pRightGather, map[string]string{"columnName": sp.TableInfo.IndexColumn[k1], "columnDataRight": newValue, "querySymbolRight": rightSymbol})
//		} else {
//			var querySymbolLeft string
//			querySymbolLeft = ">"
//			swsLeftGather = append(swsLeftGather, map[string]string{"columnName": sp.TableInfo.IndexColumn[k1], "columnDataLeft": newValue, "querySymbolLeft": ">"})
//			switch querySymbolLeft {
//			case ">=":
//				switch {
//				case oldValue == "NULL": //首行，包含null值，且是>= null and <= not null
//					for _, j := range []string{"min", "max"} {
//						newLeftGather := sliceAnyCopy(pLeftGather).([]map[string]string)
//						newRightGather := sliceAnyCopy(pRightGather).([]map[string]string)
//						switch j {
//						case "min":
//							newLeftGather = append(newLeftGather, map[string]string{"columnName": sp.TableInfo.IndexColumn[k1], "columnDataLeft": oldValue, "querySymbolLeft": "="})
//							whereRightGather = append(whereRightGather, whereRight{
//								pLeft:      pLeftGather,
//								pRight:     pRightGather,
//								compareSeq: vl.k,
//								Segment:    vl.Segment,
//							})
//						case "max":
//							newLeftGather = append(newLeftGather, map[string]string{"columnName": sp.TableInfo.IndexColumn[k1], "columnDataLeft": oldValue, "querySymbolLeft": ">"})
//							newRightGather = append(newRightGather, map[string]string{"columnName": sp.TableInfo.IndexColumn[k1], "columnDataRight": newValue, "querySymbolRight": "<="})
//							whereRightGather = append(whereRightGather, whereRight{
//								pLeft:      pLeftGather,
//								pRight:     pRightGather,
//								compareSeq: vl.k,
//								Segment:    vl.Segment,
//							})
//						}
//					}
//				case newValue == "NULL": //不可能出现
//				default:
//					pLeftGather = append(pLeftGather, map[string]string{"columnName": sp.TableInfo.IndexColumn[k1], "columnDataLeft": oldValue, "querySymbolLeft": querySymbolLeft})
//					pRightGather = append(pRightGather, map[string]string{"columnName": sp.TableInfo.IndexColumn[k1], "columnDataRight": newValue, "querySymbolRight": "<="})
//					whereRightGather = append(whereRightGather, whereRight{
//						pLeft:      pLeftGather,
//						pRight:     pRightGather,
//						compareSeq: vl.k,
//						Segment:    vl.Segment,
//					})
//				}
//			case ">":
//				pLeftGather = append(pLeftGather, map[string]string{"columnName": sp.TableInfo.IndexColumn[k1], "columnDataLeft": oldValue, "querySymbolLeft": querySymbolLeft})
//				pRightGather = append(pRightGather, map[string]string{"columnName": sp.TableInfo.IndexColumn[k1], "columnDataRight": newValue, "querySymbolRight": "<="})
//				whereRightGather = append(whereRightGather, whereRight{
//					pLeft:      pLeftGather,
//					pRight:     pRightGather,
//					compareSeq: vl.k,
//					Segment:    vl.Segment,
//				})
//			}
//		}
//	}
//	return whereLeft{swsLeft: swsLeftGather, swsRight: swsRightGather}, whereRightGather
//}
//func (sp TaskDistribution) lastValueGreaterEqFirst0(vl valueLocationInput) (whereLeft, []whereRight) {
//	var (
//		whereRightGather                                         []whereRight
//		pLeftGather, pRightGather, swsLeftGather, swsRightGather []map[string]string
//	)
//	for k1, v1 := range vl.wc {
//		oldValue, newValue := nullValue(vl.ws[k1]), nullValue(v1)
//		if k1 < len(vl.wc)-1 {
//			swsLeftGather = append(swsLeftGather, map[string]string{"columnName": sp.TableInfo.IndexColumn[k1], "columnDataLeft": oldValue, "querySymbolLeft": ">="})
//			swsRightGather = append(swsRightGather, map[string]string{"columnName": sp.TableInfo.IndexColumn[k1], "columnDataRight": newValue, "querySymbolRight": "<="})
//		} else {
//			swsLeftGather = append(swsLeftGather, map[string]string{"columnName": sp.TableInfo.IndexColumn[k1], "columnDataLeft": oldValue, "querySymbolLeft": ">"})
//		}
//		pLeftGather = append(pLeftGather, map[string]string{"columnName": sp.TableInfo.IndexColumn[k1], "columnDataLeft": oldValue, "querySymbolLeft": "="})
//		pRightGather = append(pRightGather, map[string]string{"columnName": sp.TableInfo.IndexColumn[k1], "columnDataLeft": oldValue, "querySymbolLeft": "="})
//	}
//	whereRightGather = append(whereRightGather, whereRight{
//		pLeft:      pLeftGather,
//		pRight:     pRightGather,
//		compareSeq: vl.k,
//		Segment:    vl.Segment,
//	})
//	return whereLeft{
//		swsLeft:  swsLeftGather,
//		swsRight: swsRightGather,
//	}, whereRightGather
//}
//func (sp TaskDistribution) lastValueGreaterEqFirst1(swsLeft, _, _, _ *[]map[string]string, ws, wc []string, _, _ *bool, _ int, _ map[string]int) {
//	for k1, v1 := range wc {
//		var oldValue, newValue string
//		if v1 == "<nil>" {
//			newValue = "NULL"
//		} else {
//			newValue = v1
//		}
//		if ws[k1] == "<nil>" {
//			oldValue = "NULL"
//		} else {
//			oldValue = ws[k1]
//		}
//		if k1 < len(wc)-1 {
//			*swsLeft = append(*swsLeft, map[string]string{"columnName": sp.TableInfo.IndexColumn[k1], "columnDataLeft": oldValue, "querySymbolLeft": ">="})
//		} else {
//			*swsLeft = append(*swsLeft, map[string]string{"columnName": sp.TableInfo.IndexColumn[k1], "columnDataLeft": newValue, "querySymbolLeft": ">"})
//		}
//	}
//}
//
//func (sp TaskDistribution) lastValueGreaterEqFirst100(vl valueLocationInput, _, bf *bool) (whereLeft, []whereRight) {
//	//处理首行为true，且数据< ls导致死循环无法查询到数据，数据 > ls 导致出现无法查询到数据
//	var (
//		whereRightGather              []whereRight
//		swsLeftGather, swsRightGather []map[string]string
//		//pLeftGather, pRightGather     []map[string]string
//	)
//	if len(vl.ws) == 0 && len(vl.wc) == 0 {
//		*bf = true
//	}
//	for k1, v1 := range vl.wc {
//		oldValue, newValue := nullValue(vl.ws[k1]), nullValue(v1)
//		if int64(k1) < vl.k {
//			leftSymbol, rightSymbol := eqSymbol("left", oldValue, true), eqSymbol("right", newValue, true)
//			swsLeftGather = append(swsLeftGather, map[string]string{"columnName": sp.TableInfo.IndexColumn[k1], "columnDataLeft": oldValue, "querySymbolLeft": leftSymbol})
//			swsRightGather = append(swsRightGather, map[string]string{"columnName": sp.TableInfo.IndexColumn[k1], "columnDataRight": newValue, "querySymbolRight": rightSymbol})
//			//pLeftGather = append(pLeftGather, map[string]string{"columnName": sps.TableInfo.IndexColumn[k1], "columnDataLeft": oldValue, "querySymbolLeft": leftSymbol})
//			//pRightGather = append(pRightGather, map[string]string{"columnName": sps.TableInfo.IndexColumn[k1], "columnDataRight": newValue, "querySymbolRight": rightSymbol})
//		} else {
//			swsLeftSymbol := ">"
//			//leftSymbol, rightSymbol := eqSymbol("left", oldValue), eqSymbol("right", newValue)
//			//if sps.fistRows(vl.ws, vl.wc, vl.firstLineMap) {
//			//
//			//}
//			swsLeftGather = append(swsLeftGather, map[string]string{"columnName": sp.TableInfo.IndexColumn[k1], "columnDataLeft": oldValue, "querySymbolLeft": swsLeftSymbol})
//			//pLeftGather = append(pLeftGather, map[string]string{"columnName": sps.TableInfo.IndexColumn[k1], "columnDataLeft": oldValue, "querySymbolLeft": leftSymbol})
//			//pRightGather = append(pRightGather, map[string]string{"columnName": sps.TableInfo.IndexColumn[k1], "columnDataRight": newValue, "querySymbolRight": rightSymbol})
//			//whereRightGather = append(whereRightGather, whereRight{
//			//	pLeft:  pLeftGather,
//			//	pRight: pRightGather,
//			//})
//		}
//	}
//	return whereLeft{swsLeft: swsLeftGather, swsRight: swsRightGather}, whereRightGather
//}
//
//func (sp TaskDistribution) getLastValueGreaterEqFuncMap() map[string]reflect.Value {
//	return map[string]reflect.Value{
//		"first0": reflect.ValueOf(sp.lastValueGreaterEqFirst0),
//		//"first1":   reflect.ValueOf(sps.lastValueGreaterEqFirst1),
//		"first100": reflect.ValueOf(sp.lastValueGreaterEqFirst100),
//	}
//}
//
//type conditionalValueGenerationInput struct {
//	logSeq          int64
//	logSeqNew       int64
//	object          string
//	compareResult   []int
//	ws              []string
//	wc              []string
//	nullMark        map[int]int
//	LastModifyPoint int //记录上一次联合索引的变化的索引列序号，用于判断是否进行拆分
//	swsLeftCount    int
//	firstLineMap    map[string]int
//}
//
//func (sp TaskDistribution) conditionalValueGeneration(cv conditionalValueGenerationInput, firstLine, bf *bool) (whereLeft, []whereRight) {
//	var (
//		event            = "[conditionalValueGeneration]"
//		whereRightGather []whereRight
//		whereLeftGather  whereLeft
//	)
//	sum := 0
//	if WLog != nil {
//		WLog.Info(fmt.Sprintf(fmt.Sprintf("(%d-%v) %v setup4-conditional&: Index segment data Compare successful of table%v.%v(%v) CompareValue:{ws:%v wc:%v compare:%v}", cv.logSeq, cv.logSeqNew, event, sp.TableObject.Schema, sp.TableObject.Table, sp.TableObject.PartitionName, cv.ws, cv.wc, cv.compareResult)))
//	}
//	for k, v := range cv.compareResult {
//		sum += v
//		r := valueLocationInput{
//			k:        int64(k),
//			ws:       cv.ws,
//			wc:       cv.wc,
//			nullMark: cv.nullMark,
//			//LastModifyPoint: int64(cv.LastModifyPoint),
//			firstLineMap: cv.firstLineMap,
//		}
//		if v == 1 && k == 0 { //处理前导列、单列就出现大于，
//			r.Segment = 1
//			whereLeftGather, whereRightGather = sp.leadingValue(r)
//			if WLog != nil {
//				WLog.Info(fmt.Sprintf(fmt.Sprintf("(%d-%v) %v setup4-leading&: Index segment data Compare successful of table%v.%v(%v) CompareValue:{ws:%v wc:%v compare:%v}", cv.logSeq, cv.logSeqNew, event, sp.TableObject.Schema, sp.TableObject.Table, sp.TableObject.PartitionName, cv.ws, cv.wc, cv.compareResult)))
//			}
//			break
//		} else if v == 1 && k < len(cv.compareResult)-1 { //处理非第一次循环的联合索引场景
//			whereLeftGather, whereRightGather = sp.middleValue(r)
//			if WLog != nil {
//				WLog.Info(fmt.Sprintf(fmt.Sprintf("(%d-%v) %v setup4-middle&: Index segment data Compare successful of table%v.%v(%v) CompareValue:{ws:%v wc:%v compare:%v}", cv.logSeq, cv.logSeqNew, event, sp.TableObject.Schema, sp.TableObject.Table, sp.TableObject.PartitionName, cv.ws, cv.wc, cv.compareResult)))
//			}
//			//whereLeftGather.LastModifyPoint = int64(k)
//			break
//		} else if v == 1 && k == len(cv.compareResult)-1 && sum == 1 { //多列索引，且是最后一列的索引值，且是大于值
//			r.Segment = 1
//			whereLeftGather, whereRightGather = sp.lastValueGreaterThan(r)
//			if WLog != nil {
//				WLog.Info(fmt.Sprintf(fmt.Sprintf("(%d-%v) %v setup4-last&: Index segment data Compare successful of table%v.%v(%v) CompareValue:{ws:%v wc:%v compare:%v}", cv.logSeq, cv.logSeqNew, event, sp.TableObject.Schema, sp.TableObject.Table, sp.TableObject.PartitionName, cv.ws, cv.wc, cv.compareResult)))
//			}
//			break
//		} else if v == 0 && k == len(cv.compareResult)-1 && sum == 0 { //处理只有一行数据的索引表
//			r.Segment = 1
//			whereLeftGather, whereRightGather = sp.lastValueGreaterEqFirst0(r)
//			//if c, ok := sps.getLastValueGreaterEqFuncMap()[cv.object]; ok {
//			//	argsLice := []reflect.Value{
//			//		reflect.ValueOf(r),
//			//		reflect.ValueOf(firstLine),
//			//		reflect.ValueOf(bf),
//			//	}
//			//	result := c.Call(argsLice)
//			//	whereLeftGather = result[0].Interface().(whereLeft)
//			//	whereRightGather = result[1].Interface().([]whereRight)
//			//}
//			if WLog != nil {
//				WLog.Info(fmt.Sprintf(fmt.Sprintf("(%d-%v) %v setup4-only&: Index segment data Compare successful of table %v.%v(%v) CompareValue:{ws:%v wc:%v compare:%v}", cv.logSeq, cv.logSeqNew, event, sp.TableObject.Schema, sp.TableObject.Table, sp.TableObject.PartitionName, cv.ws, cv.wc, cv.compareResult)))
//			}
//		}
//	}
//	return whereLeftGather, whereRightGather
//}
